package net.pinnoocle.playservice.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.pinnoocle.playdao.dao.MasterDao;
import net.pinnoocle.playdao.dao.MasterFinanceDao;
import net.pinnoocle.playdao.entity.MasterFinance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * 主持人财务明细(MasterFinance)表服务实现类
 *
 * @author ye
 * @since 2021-11-09 17:40:13
 */
@Service("masterFinanceService")
public class MasterFinanceServiceImpl extends ServiceImpl<MasterFinanceDao, MasterFinance>{

    @Autowired
    MasterDao masterDao;

    /**
     * 获取主持人余额
     * @param masterId
     * @return
     */
    public BigDecimal getMasterBalance(String masterId){
        return masterDao.getMasterBalance(masterId);
    }

    /**
     * 更新主持人累计收益
     * @param masterId
     * @param amount
     * @return
     */
    public boolean updateTotalAmount(String masterId,Double amount) {
        return masterDao.updateTotalAmount(masterId, amount);
    }
}